const ALL = 0 // 全部
const GOOD = 1 // 满意
const BAD = 2 // 不满意


export default {

  data() {
    return {
      m_onlyContent: true,
      m_currentRatingGroup: ALL
    }
  },

  computed: {
    filterRatings() {
      let ret = []
      this.ratings.forEach((item)=>{
        if(this.m_onlyContent && item.text.trim().length===0)
          return true

        if(this.m_currentRatingGroup>0)
          if( (this.m_currentRatingGroup-1)!==item.rateType )
            return true

        ret.push(item)
      })
      console.log('filterRatings:')
      console.log(ret)
      return ret
    }
  },

  methods: {
    onSelectCurrentGroup(current) {
      this.m_currentRatingGroup = current
    },

    onSelectOnlyContent(val) {
      this.m_onlyContent = val
    }
  }

}